<template>
    <a-modal 
    class="my-modal short" 
    v-model:visible="modal_show" 
    title="输入路径" 
    @ok="modelok" 
    width="50%" 
    :maskClosable="false" 
    :centered="true"
    :destroyOnClose="true"
    >
        <div class="body-content" >

            <a-form
            :model="task_val"
            name="basic"
            :label-col="{ span: 6 }"
            :wrapper-col="{ span: 18 }"
            autocomplete="off"
            >
                <a-form-item label="不规则影像文件夹">
                    <a-col :span="22">
                        <a-input  size="small" v-model:value="dir" /> 
                    </a-col>
                </a-form-item>
                <a-form-item label="影像类型">
                    <a-col :span="22">
                        <a-space direction="vertical">
                        <a-radio-group v-model:value="tif_type" size="small" >
                            <a-radio-button value="Optical">Optical</a-radio-button>
                            <a-radio-button value="Hyperspectral">Hyperspectral</a-radio-button>
                            <a-radio-button value="Sar">Sar</a-radio-button>
                        </a-radio-group>
                        </a-space>
                    </a-col>
                </a-form-item>
            </a-form>
        </div>
    </a-modal>
</template>
<script>
export default {
    components: {},
    data() {
        return {
            modal_show: false,
            task_val:{},
            dir:"",
            tif_type:"",


            //mitt
            mitt_input_dir_ys_id:"",
            mitt_input_dir_ys_back_id:"",
        };

        
    },
    beforeUnmount() {
        this.$mitt.off('input_dir_ys',this.mitt_input_dir_ys_id);
    },
    mounted() { 
        this.mitt_input_dir_ys_id=this.$mitt.on('input_dir_ys',(uid,_options)  => {
            this.mitt_input_dir_ys_back_id=uid
            this.dir = "";
            this.tif_type = "Optical";
            this.modal_show = true;
        });
    },
    methods: {
        async modelok() {
            this.$mitt.oemit('input_dir_ys_back',{
                dir:this.dir,
                tif_type:this.tif_type,
            },this.mitt_input_dir_ys_back_id);
            this.modal_show = false;
        },
    },
};
</script>